﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true"
    CodeFile="ManagerProduct.aspx.cs" Inherits="admin_product" Title="Untitled Page" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <title>Manager Product</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContent" runat="Server">
    <div style="float: right; margin-right: 10px">
        <asp:Label ID="Label1" runat="server" Text="Search"></asp:Label>
        &nbsp;<asp:DropDownList ID="DropDownListSearchPr" runat="server" Width="100px">
            <asp:ListItem>Name</asp:ListItem>
            <asp:ListItem>ID</asp:ListItem>
        </asp:DropDownList>
        &nbsp;<asp:TextBox ID="TextBoxSrch" runat="server" Width="200px"></asp:TextBox>
        &nbsp;
        <asp:Button ID="ButtonProduct" runat="server" BorderStyle="Solid" Text="OK" OnClick="ButtonProduct_Click" />
    </div>
    <br />
    <br />
    <asp:GridView ID="grvProduct" runat="server" Width="750px" AutoGenerateColumns="False"
        OnRowDeleting="grvProduct_RowDeleting" DataKeyNames="pd_id" 
        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
        CellPadding="3" ForeColor="Black" GridLines="Vertical">
        <Columns>
            <asp:BoundField DataField="pd_id" HeaderText="ID" ReadOnly="True" SortExpression="pd_id" />
            <asp:TemplateField HeaderText="NAME">
                <ItemTemplate>
                    <%#Eval("pd_name")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="DESCRIPTION">
                <ItemTemplate>
                    <%#Eval("pd_description")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="QUANTITY">
                <ItemTemplate>
                    <%#Eval("pd_quantity")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="PRICE">
                <ItemTemplate>
                    <%#Eval("pd_price")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="IMAGES">
                <ItemTemplate>
                    <img src='<%#Eval("pd_image")%>' width="100px" alt="" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="EDIT">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkBEdit" runat="server" OnCommand="LinkBEdit_Command" CommandName="Edit"
                        CommandArgument='<%#Eval("pd_id")%>'>Edit</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="DELETE">
                <ItemTemplate>
                    <span onclick="return confirm('Are you sure to Delete the record?')">
                        <asp:LinkButton ID="LinkB" runat="server" CommandName="Delete">Delete</asp:LinkButton>
                    </span>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="#CCCCCC" />
    </asp:GridView>
    <cc1:CollectionPager ID="ClPageProduct" runat="server" MaxPages="5" PageSize="8"
        ResultsFormat="Display: {0}-{1} (of {2})" ResultsStyle="margin-left: 0px;" ControlCssClass="CollectionPager"
        LabelText="Page:" PageNumbersDisplay="Numbers" ResultsLocation="None" ShowFirstLast="True"
        SliderSize="5" FirstText="First" LabelStyle="margin-left: 5px;" BackNextDisplay="Buttons"
        BackNextButtonStyle="" BackNextStyle="margin: 10px;" ControlStyle="border: 1px solid #666;margin-top: 5px;"
        PagingMode="QueryString" SectionPadding="10">
    </cc1:CollectionPager>
</asp:Content>
